UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cmuJMZTcx8vwQNVU7VUQtEJ6OK5/+ZQxx3sLWRHlaVs=' 
WHERE 
  key_id = 'b3f68b02d11f080a151cdb504cb948d2375e9943d003389192d286ca23249a5e' 
  AND (
    token = 'cmuJMZTcx8vwQNVU7VUQtEJ6OK5/+ZQxx3sLWRHlaVs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058