UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZmKEZDvpWNlrUBwKGO7mps+idVqcwP7rqQbJYBxNefU=' 
WHERE 
  key_id = '3676f67f6688acb5106e774dc3371be16575579177eedc16b08b4bddab011124' 
  AND (
    token = 'ZmKEZDvpWNlrUBwKGO7mps+idVqcwP7rqQbJYBxNefU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031