UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8PzYKMyYAF2fB2ytGGfXdZ8vv2NS7pOwj/QNWo+gt9Y=' 
WHERE 
  key_id = '174ddedbd3fe3f2bc97294099d2b3e78202102ddb8c69655a1d6508bd494589a' 
  AND (
    token = '8PzYKMyYAF2fB2ytGGfXdZ8vv2NS7pOwj/QNWo+gt9Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054