UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z6nWWQx6gerVJ/GDC2SwvkqZ6DOEqncMhX3uqM0I0bY='
WHERE
key_id = '4bd7738e75cfc8fa13e03bab758891a158f7ce825d8a232b3ecf73c47ecfba13'
AND (
token = 'Z6nWWQx6gerVJ/GDC2SwvkqZ6DOEqncMhX3uqM0I0bY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)