UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9JItsFXB4VI+tCE5VToo2RxPHlKspYx3hhzmDrs9804='
WHERE
key_id = '4af305005f5a597d9c1ca9924ac3daf508cbcdf4c6be0d3b6a76d37c99b35515'
AND (
token = '9JItsFXB4VI+tCE5VToo2RxPHlKspYx3hhzmDrs9804='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)