UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CrPEkMeliNpx3H2bslQJTvBvM5z/ITKQmQDO9y2ovwI='
WHERE
key_id = '02a7a09e330e6e477592b589296046dcb33a9251ff467d0814e51c0ee242dc91'
AND (
token = 'CrPEkMeliNpx3H2bslQJTvBvM5z/ITKQmQDO9y2ovwI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)