UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OBkywPlfsGyuhJACJ0LuUepKQfiLE8CmtYXl6Z4lSc4=' 
WHERE 
  key_id = '87695487adb99f45238303d3a8a7f40140b2c73e8a9ee50c286c7a70b249f7e6' 
  AND (
    token = 'OBkywPlfsGyuhJACJ0LuUepKQfiLE8CmtYXl6Z4lSc4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045