UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lHEihOKHlcPdjXlupS63AyCeFD40AqaXgQ85srhKTsw='
WHERE
key_id = 'cf72c0081515e23ba469838cae89a0a865b61ca41ffbeb1ff411bb4ae1436cb1'
AND (
token = 'lHEihOKHlcPdjXlupS63AyCeFD40AqaXgQ85srhKTsw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)