UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OPD4v/0+KKjFkWLrXPMiUjyTETVXJF39SKTz7f2WH7U=' 
WHERE 
  key_id = '7438cd6efc697f19c1bcd2d1cd0e1223aed8dba8fca2f8ab40933b102331cb26' 
  AND (
    token = 'OPD4v/0+KKjFkWLrXPMiUjyTETVXJF39SKTz7f2WH7U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023