UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r3yzB3KZsHkuI0wmW/KCA8fMSsDwNhASuLj1D2wp8bM='
WHERE
key_id = '00c79e89ae11785669208582ff845a1a6dfe9be59ba4e610f20726eb6081caf3'
AND (
token = 'r3yzB3KZsHkuI0wmW/KCA8fMSsDwNhASuLj1D2wp8bM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)