UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4UvWyQapcsyd08wDnjo+jEbj7EEu3pcBahHmvsQLcBs='
WHERE
key_id = '8357bbcd34d40a389281b30a9c0b6960a023d900761806c5943696e5e76f235e'
AND (
token = '4UvWyQapcsyd08wDnjo+jEbj7EEu3pcBahHmvsQLcBs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)