UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dlsrxIm5UTV0uo6ts/sWXft7UXwPgNYqy/eFCTDLKhw='
WHERE
key_id = '399fb6933d6b9f3200af2e85a0ec1b4b8a420c9f87f98b6dadd7a225b2562a7c'
AND (
token = 'dlsrxIm5UTV0uo6ts/sWXft7UXwPgNYqy/eFCTDLKhw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)