UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0oBqNR/JrHg2p8zhM1D5pTQ3/a6icDYv/RjkU8wfIUk='
WHERE
key_id = '33a93afb5693796ec4b43b432ea6ee0414332a8da39f417757a5532aef6858c9'
AND (
token = '0oBqNR/JrHg2p8zhM1D5pTQ3/a6icDYv/RjkU8wfIUk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)