UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tRsR3JkSGID9tMyusr+ZKkBavjMEOpXP4TkVMPtPAQA=' 
WHERE 
  key_id = '883e904c7cd10ac516dbe2bbd1b82fb0b453c05cbb7695134015a8a9447f140b' 
  AND (
    token = 'tRsR3JkSGID9tMyusr+ZKkBavjMEOpXP4TkVMPtPAQA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040