UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '//8b4MSScg45f7aoKeEnsrlVW1rywvlQjho8xmH74ZA='
WHERE
key_id = '1885da5fec0c854ae93d61b69b1cfaf560d698fa6c3b3426f2a222076d2e86d3'
AND (
token = '//8b4MSScg45f7aoKeEnsrlVW1rywvlQjho8xmH74ZA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)