UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PVeXwgtB7gX8lr7Os6xuIJmO0XBBx6jfCaUU/HqlQ0s='
WHERE
key_id = 'a79ee16d1d4f86c633473c8701c3b721549fc0c6127333d5988dabb85f232ef2'
AND (
token = 'PVeXwgtB7gX8lr7Os6xuIJmO0XBBx6jfCaUU/HqlQ0s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)