UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xbm1npEbNGEs19UKoXdykW8krsV8m2auA0FTdyw6bVo='
WHERE
key_id = '18503712285738a6222f63269850c9181df61f913278879a006082a8f980af8f'
AND (
token = 'xbm1npEbNGEs19UKoXdykW8krsV8m2auA0FTdyw6bVo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)