UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zo3r1E7/LT2sf/EXtM0N/U5WS72N6PTwFOrHM3+zJT4=' 
WHERE 
  key_id = 'ca4ef026fa31eddcaf6e49f995deae9736e6413a5b8965cc8d5340163c7d4f84' 
  AND (
    token = 'zo3r1E7/LT2sf/EXtM0N/U5WS72N6PTwFOrHM3+zJT4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040