UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BISXtz78z8cDm6RjAmpZZOtSs0Rp1f8aY2n9YJk3keE='
WHERE
key_id = '03f34eb0f05ed9e50fe2e5c8e2d9e0133967ae8ad61746e0746e6a9549c9c919'
AND (
token = 'BISXtz78z8cDm6RjAmpZZOtSs0Rp1f8aY2n9YJk3keE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)