UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zAUzd8Hn/ulr1wpILqYo6U3Hno7A6EPV+U5/OiPbB+M=' 
WHERE 
  key_id = '1c707f9c706257631cd2a0ea5481b1a6820d8046c8cb55eb774d505d962969f9' 
  AND (
    token = 'zAUzd8Hn/ulr1wpILqYo6U3Hno7A6EPV+U5/OiPbB+M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053