UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rfb0SO2dbevITRKQMdaKEKxJgb53MAroaXV4JWR5ozg='
WHERE
key_id = '29f0ba1ea2c45e4e19d8efc33a7126c74dfbb6fdb74dff9804d481f08419be0a'
AND (
token = 'rfb0SO2dbevITRKQMdaKEKxJgb53MAroaXV4JWR5ozg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)