UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Qg60YHmYE+bUGxSfu+gzvkuqLksoPHKhekt206qw9io=' 
WHERE 
  key_id = 'e08c0f76de9172e765842c9cf53f7a091ff356caf48c50060df2f1cdd59ecff6' 
  AND (
    token = 'Qg60YHmYE+bUGxSfu+gzvkuqLksoPHKhekt206qw9io=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014