UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GyfeyfHa2J8/WopFqJmaZAyhLGkK7qzIihclkjUvwvw=' 
WHERE 
  key_id = 'b2bb954b101da810e9e352da3cdf973bffd493a73c3c364b4243b0700f933e4a' 
  AND (
    token = 'GyfeyfHa2J8/WopFqJmaZAyhLGkK7qzIihclkjUvwvw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026