UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vUBCRy/t5P/mGKloH1cxkhIEkh7B3H5cEYT11Te5ZEY='
WHERE
key_id = 'd502b5a52d8f84e81ca46b9cc1c3e70aedc8461494d999e40971d725e3f31aa9'
AND (
token = 'vUBCRy/t5P/mGKloH1cxkhIEkh7B3H5cEYT11Te5ZEY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)