UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Bn0dabSrgBlM7+1vYy9IyfQNT3rnoBfuDOJGIQyjte4=' 
WHERE 
  key_id = 'ff8bb1b3d7d26d4b72d1e108ae9215aa1c177c58cbc56f0517864b62c8550e24' 
  AND (
    token = 'Bn0dabSrgBlM7+1vYy9IyfQNT3rnoBfuDOJGIQyjte4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038