UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GGtZK/1JbdEP3g+DVWB9F/hKKzSaEke68aRV+QDcDmA=' 
WHERE 
  key_id = '1836ff50ebbd97595bbd6e7652d9df646d71176c1cf69497549f18c882c29860' 
  AND (
    token = 'GGtZK/1JbdEP3g+DVWB9F/hKKzSaEke68aRV+QDcDmA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039