UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WBajKPmjOyGr5U6WIeVIxwGVk37iFe+KQmt45/zcI1s='
WHERE
key_id = '42f423fc8763d0475cabf4f27b579dc2c32f1df7570bfa9f6eba65f12bcbd422'
AND (
token = 'WBajKPmjOyGr5U6WIeVIxwGVk37iFe+KQmt45/zcI1s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)