UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VaMysr5MRHiJuA05o2HI3r9G/+aWFwfdG28ZsCl86vQ='
WHERE
key_id = '0efbd766f2f8c0ec4d988a069ae16eb70e864cddb200be17a84b01cc0412affa'
AND (
token = 'VaMysr5MRHiJuA05o2HI3r9G/+aWFwfdG28ZsCl86vQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)