UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2wgxBhDytOiJ5/nmZaicejw5Wt3aDEHD6q450LK92Q0=' 
WHERE 
  key_id = '90cc7d7d4da94ecff6dab61e9dd474440ef4a636ac05161cc6470ff8b7888cc0' 
  AND (
    token = '2wgxBhDytOiJ5/nmZaicejw5Wt3aDEHD6q450LK92Q0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042