UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ONxLTE/xDPgRN5qPAlDkSflOuCsRqIo9XATG4Iu5kQg=' 
WHERE 
  key_id = '233b5258009db75e327edc6577c9189da41bb79987629214edbfb109ff7b4c5b' 
  AND (
    token = 'ONxLTE/xDPgRN5qPAlDkSflOuCsRqIo9XATG4Iu5kQg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038