UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+A1rk1xzH23MEARKXxYCp5WAarSCUrmDezFzKydg9g4='
WHERE
key_id = '9e69f23e0b21001fb94aa8667bf0e026540263a6ffdfff9a4ded4fd6ba8c5a5a'
AND (
token = '+A1rk1xzH23MEARKXxYCp5WAarSCUrmDezFzKydg9g4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)