UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6sCiAjDpLv1r4j4qNRPujeA37yTXeZ7lDq3L2kxOlBc=' 
WHERE 
  key_id = '30f6073363921cdbe84210e18141375c1bf3441b622158eb1ec739944216d609' 
  AND (
    token = '6sCiAjDpLv1r4j4qNRPujeA37yTXeZ7lDq3L2kxOlBc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025