UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fGgOp6UrlxVNU0nem/hh08MpJj6dwy4xMmIAcqvaNls='
WHERE
key_id = '5871352c158e7477da4b0381e1f2fd0ab7e3402cc242fe6e5ea92696b2e308d7'
AND (
token = 'fGgOp6UrlxVNU0nem/hh08MpJj6dwy4xMmIAcqvaNls='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)