UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6kzXin13oTUCZ8qY/EHOEGXHByF+HWnnZ2ifM20MPbo='
WHERE
key_id = '0c8c2f14383eaca930fea31c459291f0f1a024449add974a1cf7f81ed7ecbe68'
AND (
token = '6kzXin13oTUCZ8qY/EHOEGXHByF+HWnnZ2ifM20MPbo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)