UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'a/n3uN7SzuekDDlbE/D86Eo9vizAZS1IRApRzhplkWY=' 
WHERE 
  key_id = 'd68b8243512702950fe4536f5100643fc6ff3e4cf0f40fce91a4518dba54c9ef' 
  AND (
    token = 'a/n3uN7SzuekDDlbE/D86Eo9vizAZS1IRApRzhplkWY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041