UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mgzzBjk+Q6p12BjR+xWdu+UG12fRrvJAKkuXnfsCUsc=' 
WHERE 
  key_id = '966aa1d4b81e9429af8cc72fb21769cf2e16480a67ebd1bcc4e06ca700085a73' 
  AND (
    token = 'mgzzBjk+Q6p12BjR+xWdu+UG12fRrvJAKkuXnfsCUsc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033