UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j/PbpCCAWIkxw6Mc3hq5VOXzlQfRHThcZtBVO8cNZOY=' 
WHERE 
  key_id = 'b75a8e7260fb2e71cd7e08c0facd839ba336991c6fde409404d87e5c0472a5bd' 
  AND (
    token = 'j/PbpCCAWIkxw6Mc3hq5VOXzlQfRHThcZtBVO8cNZOY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047