UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E18EPBEfB5lAbJz+BfviDc3Cwd6KUP7Oh48VQZ5wcHk='
WHERE
key_id = '00efc2efe13fd9ec04c43421c3a9a95f7252ea15427b9bdd4ccd15a23404076c'
AND (
token = 'E18EPBEfB5lAbJz+BfviDc3Cwd6KUP7Oh48VQZ5wcHk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)