UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6hGa6z6Ys1lshzurVuMQQtImxvLTS/MxpdRa05jorik='
WHERE
key_id = 'dbdf3eed59f7e746f56f86cff98de65ea9ad751653f940fde6a6bd6c54a4e3e1'
AND (
token = '6hGa6z6Ys1lshzurVuMQQtImxvLTS/MxpdRa05jorik='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)