UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8hEWdqFqjPV4JfEguOMn2+xks4AAro6vxRcLQw/e7F8=' 
WHERE 
  key_id = '619b8dbd9cbf01a9c1b7d1e9410bd220cf84c1750d60d2f45f4e27002bc03d52' 
  AND (
    token = '8hEWdqFqjPV4JfEguOMn2+xks4AAro6vxRcLQw/e7F8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025