UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ePgb/gS3O4ulkMhixIaHbqzi6NIz7RN72vDNM/7vLAU='
WHERE
key_id = 'ccb0ab5173e46706fc2e8311c04bcd7e8aa58a0e5af564f4739c725ef95ce657'
AND (
token = 'ePgb/gS3O4ulkMhixIaHbqzi6NIz7RN72vDNM/7vLAU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)