UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lR0ghy2Dlkujqw3Fvf/qC9f+VmbSJBgpg5HW1GmvOu0='
WHERE
key_id = 'dfbd8a968518a811abfd676a838c623434314e9ebd18af0977ffb3bba48fee97'
AND (
token = 'lR0ghy2Dlkujqw3Fvf/qC9f+VmbSJBgpg5HW1GmvOu0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)