UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b3+BuUC1qESJyWTh00d99bXn6pckTySIzYT1V8zTFAA=' 
WHERE 
  key_id = '0975121ff6400e4b6f4352259185a54645f03de9b9baacdc564dc1ab8ef17fc5' 
  AND (
    token = 'b3+BuUC1qESJyWTh00d99bXn6pckTySIzYT1V8zTFAA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027