UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RcrqfBgWf9PBuFl+MLLYto/yDPFph/h3dZYgzAByuME=' 
WHERE 
  key_id = 'ab0c6a5bcf3bd90af19af8117486ad75639746b66609724fe34793779ad91a95' 
  AND (
    token = 'RcrqfBgWf9PBuFl+MLLYto/yDPFph/h3dZYgzAByuME=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036