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